import { Pipe, PipeTransform } from "@angular/core";

@Pipe({
    "name": "separate"
})
export class SeparatePipe implements PipeTransform {
    transform(origin:string[], size:number) {
        return Array.prototype.map.call(origin, (char, index) => {
            if (index % size === 0) {
                return " " + char;
            } else {
                return char;
            }
        }).join("");
    }
}